package com.tjtt.tdm.system.service;

import java.util.List;

import com.tjtt.tdm.exception.ServiceException;
import com.tjtt.tdm.system.bean.Menu;
import com.tjtt.tdm.system.bean.Opratingbutton;

public interface MenuService {
	
	/**
	 * 根据当前父节点Id查询属于该节点的子菜单
	 * @param parentId
	 * @return Menus
	 * @throws ServiceException
	 */
	public List<Menu> findMenuByParentId(Long parentId) throws ServiceException;
	/**
	 * 保存菜单
	 * @param menu
	 * @throws ServiceException
	 */
	public String saveMenu(Menu menu) throws ServiceException;
	
	/**
	 * 根据菜单Id删除菜单数据
	 * @param menuId
	 * @throws ServiceException
	 */
	public void delMenu(Long menuId) throws ServiceException;
	/**
	 * 菜单修改
	 * @param menu
	 * @throws ServiceException
	 */
	public void updateMenu(Menu menu) throws ServiceException;
	/**
	 * 根据菜单ID获取当前菜单信息
	 * @param menuId
	 * @return
	 * @throws ServiceException
	 */
	public Menu getMenuById(Long menuId) throws ServiceException;
	/**
	 * 保存菜单
	 * @param menu
	 * @throws ServiceException
	 */
	public void saveMenuButton(Opratingbutton button) throws ServiceException;
	
	/**
	 * 根据菜单Id删除菜单数据
	 * @param menuId
	 * @throws ServiceException
	 */
	public void delMenuButton(Long menuId) throws ServiceException;
	/**
	 * 排序菜单
	 * author:lishu	 2015-3-4
	 */
	public void executeSQL(String sql) throws ServiceException;
	public List<Menu> executeHql(String sql) throws ServiceException;
	/**
	 * 菜单修改
	 * @param menu
	 * @throws ServiceException
	 */
	public void updateMenuButton(Opratingbutton button) throws ServiceException;
	/**
	 * 根据菜单ID获取当前菜单信息
	 * @param menuId
	 * @return
	 * @throws ServiceException
	 */
	public Opratingbutton getMenuButtonById(Long buttonId) throws ServiceException;
	
	/**
	 * 角色菜单查询
	 * @param parentId
	 * @param roleId
	 * @return
	 * @throws ServiceException
	 */
	public List<Menu> findMenuByRoleId(Long parentId,String roleId) throws ServiceException;
	/**
	 * 获取所有功能菜单
	 * @return
	 */
	public List<Menu> getAllMenu() throws ServiceException;
	/**
	 * 按菜单名查询所有菜单
	 * @param menuName
	 * @return
	 * @throws ServiceException
	 * cm 2011-9-22
	 */
	public List<Menu> findByProperty(String menuName) throws ServiceException;
	 
	
	/**
	 * 根据角色和模块Id查询所有的按钮
	 * @param roleid
	 * @param moduleid
	 * @return String
	 * @author 李数
	 * @date 2012-10-9 上午11:10:06
	 */
	public String getRoleModulebutton(String roleid,String moduleid) throws ServiceException;
	/**
	 * 查詢菜單數據
	 * author:lishu	 2015-3-4
	 */
	public String queryMenuTree() throws ServiceException;
	
	public String queryMenuTreeClose() throws ServiceException;
	/**
	 * 查询菜单对应按钮
	 * author:lishu	 2015-3-4
	 */
	public String queryMenuButton(String menuId) throws ServiceException; 
}
